#include"tcpservver.hpp"
#include"dict.hpp"

int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        std::cout<<"输入方式错误,应该为:./tcpserver port"<<std::endl;
        exit(0);
    }
    dict d;
    uint16_t port=std::stoi(argv[1]);
    tcpserver* t=new tcpserver(port,[&d](std::string& en,Addr& cli)->std::string{
        return d.Translate(en,cli);
    });
    t->Init();
    t->Start();
    return 0;
}